<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="loginTitle" ContentPlaceHolderID="TitleContent" runat="server">Sqwarea: Settings</asp:Content>

<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Settings for <%= ViewData["Nickname"] %></h1>   
    <p>
        Here you can modify your email address and the language you want to use.
    </p>
    <%= Html.ValidationSummary("Account informations successfully updated!")%>

    <% using (Html.BeginForm()) { %>
      <fieldset>
        <legend>Account Information</legend>
        <% if (((List<string>)ViewData["Messages"]).Count > 0) { %>
        <ul>
          <% foreach(var message in ((List<string>)ViewData["Messages"]) ) { %>
            <li><%= message %></li>
	      <% } %>
        </ul>
        <% } %>
        <p>
          <label for="nickname">Nickname:</label>
          <%= Html.TextBox("nickname", ViewData["Nickname"])%>
        </p>
        <p>
          <label for="email">Email:</label>
          <%= Html.TextBox("email", ViewData["Email"])%>
        </p>
        <p>
           <label for="username">Language:</label>
           <%= Html.DropDownList("language", (IEnumerable<SelectListItem>) ViewData["Languages"], ViewData["Language"])%>
        </p>
        <p class="formButtons">
          <input type="submit" value="Save" />
        </p>
      </fieldset>
    <% } %>
    <p style="text-align: right;">
      <%= Html.ActionLink("Delete my account", "Delete", "Account") %> &mdash;
      <%= Html.ActionLink("Change my OpenId", "ChangeOpenId", "Account") %>.
    </p>
</asp:Content>
